﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Xwang.Task.Bll;
using Xwang.Task.IBll;

namespace Xwang.Task.WebUI.Controllers
{
    public class UserController : Controller
    {
        public IUserInfoService UserInfoService { get; set; }
        //
        // GET: /User/

        public ActionResult Index()
        {
            return View();
        }


        [HttpPost]

        public ActionResult CheckUser(string loginId, string pwd)
        {
            Model.UserInfo user =
                UserInfoService.LoadEntities(u => u.LoginId == loginId && u.Pwd == pwd).FirstOrDefault();
            if (user == null)
            {
                return Content("用户名密码错误");
            }
            Session["LoginUser"] = user;
            return Content("ok");
        }

      
    }
}
